Inserted only before, after one or more line breaks, and at the end of program inputThis means that you can only omit semicolons in a row, a block of code, and where a program ends.Which means you can write code like this.function Square (x) { var n = +x return n * n}But it can't be written like the code below, so it's an error.function Area (r) { r = +r return math.pi*r*r}//errorInserted only when subsequent input tags cannot be resolvedIn other words,
First, prefaceTonight in the eyes of the people to see the front-end technical experts-He Shijun on the JavaScript sentence should be added semicolon? "The answer, let me once again see Daniel's style, really admire extremely." But pure admiration is not enough to repay him such excellent words, must understand the meaning of the text and the principle behind it deserves it!Prior to this we need to understand the ASI (automatic
JS magic Hall: ASI (automatic semicolon insertion mechanism) and Front semicolonI. Preface I will see the frontend Technical Expert of the People's Network in zhihu tonight-He Shijun-should I add points to JavaScript statements? The answer, let me once again see the elegant style of Daniel, really admire. However, the Pure admiration is not enough to return to such excellent texts. It is worthy of understanding the meaning of the texts and the princip
Look at the code:
Html:
Copy Code code as follows:
Index.js content:
Copy Code code as follows:
/*
Author:binarytree
*/
Fill a local reference to a picture
Ext.blank_image_url = ' resources/images/default/s.gif ';
Name space
Ext.namespace (' MyNamespace ');
Creating an Application
Mynamespace.app = function ()
{
Return
{
Init:function ()
{
Alert (' Initialization of program completed ');
}
};
}();
Online index, wai
When reading Extjs Chinese manual today, I wrote four or five lines of sample code. As a result, IE and Firefox failed to report an error.
Check the Code:
HTML:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1 2 3 4 5 6 7
8
9
10
13 14
15 16 17 18 19 20 21 22
Index. js content:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1 /*
2 Author: binarytree
3 */
4 // fill in the local reference
Check the Code:
HTML:
Copy codeThe Code is as follows:
Index. js content:Copy codeThe Code is as follows :/*Author: binarytree*/// Fill in the local reference of the imageExt. BLANK_IMAGE_URL = 'resources/images/default/s.gif ';// NamespaceExt. namespace ('mynamespace ');// Create an applicationMyNameSpace. app = function (){Return{Init: function (){Alert ('program initialization completed ');}};}();
The following results are indexed on the Internet: ECMAScript stipulates that in some cases,
[Note] JavaScript coding specifications-comma and semicolon, and javascript semicolon
Do not use a comma before a statement.
// Badvar story = [once, upon, aTime]; // goodvar story = [once, upon, aTime];
Do not include extra commas: this will cause some problems in the weird modes of IE6, IE7, and IE9. At the same time, in some implementations of ES3, extra commas will increase the length of the array.
Core tip: in a project, one time to use:: Selection pseudo element, and then the development classmate asked me, CSS in a colon and two colon god horse difference?In a project, once to use:: Selection pseudo element, and then the development classmate asked me, CSS in a colon and two colon god horse difference?
This s
1. Colon (:) usage(1) Represents the definition of a bit field within a mechanism (that is, the variable occupies several bit spaces)typedef struct _xxx{ unsigned char a:4; Char character a accounts for 4 bits unsigned char c;} XXX;(2) The colon after the constructor is split, which isclass to assign a value to a member variable, initialize the list, which is more applicable to const
Web page Production WEBJX article introduction: in a project, once to use:: Selection pseudo element, and then the development classmate asked me, CSS in a colon and two colon god horse difference?
In a project, once to use:: Selection pseudo element, and then the development classmate asked me, CSS in a colon and two
Transferred from: http://blog.csdn.net/zimingjushi/article/details/65493901. Colon (:) usage(1) Represents the definition of a bit field within a mechanism (that is, the variable occupies several bit spaces)typedef struct _xxx{unsigned char a:4;unsigned char c;} ; Xxx(2) The colon at the back of the constructor functions as a method of assigning a value to a member variable, initializing the list, and more
1. colon (:) usage
(1) indicates the structure body.Bit domain(That is, the variable occupies several bit spaces)
Typedef struct _ XXX {
Unsigned char A: 4;
Unsigned char C;
} Xxx;
(2) The colon following the constructor acts as a segmentation function. It is a class-based method for assigning values to member variables. The initialization list is more suitable for the constant const type of member variab
Python indentation and colon description, python indent colon
For Python, code indentation is a syntax. Python does not use {} or begin like other languages... end separates code blocks, but uses code indentation and colons to differentiate the layers between codes.
The number of white spaces for indentation is variable, but all code block statements must contain the same number of white spaces for indentat
Double colon: usage in PHP and usage in php. Double colon: usage in PHP. a few days ago, I saw someone asking about the usage of double colon: in php, at that time, his answer was concise because the mobile phone had a double colon: usage in PHP, usage in php with a colon
A
Double colon:: Usage in PHP, colon php use case
A few days ago in Baidu know inside see someone asked PHP double colon:: The use, at that time to his answer is relatively concise because the phone typing is not convenient! It suddenly comes to mind today, so here's a summary of the double colons I've encountered:: What to use in PHP!
The double-
In PHP, the double colon: is used, and the php colon is used. PHP double colon: usage, php colon usage a few days ago in Baidu know that someone asked PHP double colon: usage, at that time, his answer was concise, because mobile phone typing was not very convenient. in PHP,
1. colon (:) usage
(1) represents the definition of the location domain in the structure (that is, the variable occupies several bit spaces)
Typedef struct _ XXX {
Unsigned char a: 4;
Unsigned char c;
} XXX;
(2) The colon following the constructor acts as a segmentation function. It is a class-based method for assigning values to member variables. The initialization list is more suitable for the constant co
Double colon ":", colon
Scope qualifier or operator,":" It is used to declare the class of the function, and the class is used to declare the member function.
Void Student: display ();
A class Student is declared, and a member function void display () is declared in the class Student, but the display definition is not provided in the class declaration. When the display definition is defined outside the c
(1) denotes the definition of an institution's inner-field (that is, the variable takes up several bit spaces)
Copy Code code as follows:
typedef struct _xxx{
unsigned char a:4;
unsigned char c;
} ; Xxx
(2) The colon at the back of the constructor splits, the method that the class assigns to the member variable, initializes the list, and is more applicable to the constant const type of the member variable.
Copy Code
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.